export const handleViteImages = (imgPath: string, imgPrePath = "") => {
  try {
    const getSplit = imgPath.split("/");
    const getName = getSplit[getSplit.length - 1];
    if (imgPrePath)
      return new URL(
        `../assets/image/${imgPrePath}/${getName}`,
        import.meta.url
      ).href;

    return new URL(`../assets/image/${getName}`, import.meta.url).href;
  } catch (error) {
    console.warn(error);
  }
};
